#include <bits/stdc++.h>
using namespace std;
int n, m;
const int N = 1e5 + 10;
int city[N], tower[N];
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; ++i) cin >> city[i];
  for (int i = 0; i < m; ++i) cin >> tower[i];
  sort(city, city + n);
  sort(tower, tower + m);
}
